package com.cspg.ssss.service;

import com.cspg.ssss.domain.DwdggbmjdTemporaryEntity;
import com.cspg.ssss.repository.DwdggbmjdTemporaryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
public class DwdggbmjdTemporaryService {
    @Autowired
    private DwdggbmjdTemporaryMapper dwdggbmjdTemporaryMapper;


    public int Add(DwdggbmjdTemporaryEntity dwdggbmjdTemporaryEntity){
        return dwdggbmjdTemporaryMapper.insert(dwdggbmjdTemporaryEntity);
    }

    public List<DwdggbmjdTemporaryEntity> selectDataById(String id){
        return dwdggbmjdTemporaryMapper.selectDataById(id);
    }

   public List<DwdggbmjdTemporaryEntity> selectAll(String id){

        return dwdggbmjdTemporaryMapper.selectAll(id);
    }
    @Transactional(rollbackFor = Exception.class)
    public int batchInsert(List<DwdggbmjdTemporaryEntity> list){
        int c=0;
        try{
             c= dwdggbmjdTemporaryMapper.batchInsert(list);
        }catch (Exception e){
            e.printStackTrace();
            return c;
        }
        return c;
    }
    @Transactional(rollbackFor = Exception.class)
    public int deleteByList(List<DwdggbmjdTemporaryEntity> list){
        int c=0;
        try{
            c= dwdggbmjdTemporaryMapper.deleteByList(list);
        }catch (Exception e){
            e.printStackTrace();
            return c;
        }
        return c;
    }

    public int updateData(DwdggbmjdTemporaryEntity record){
        return dwdggbmjdTemporaryMapper.updateData(record);
    }

    public int delete(String id){
        return dwdggbmjdTemporaryMapper.deleteData(id);
    }

    public DwdggbmjdTemporaryEntity selectDataId(String id){
        return dwdggbmjdTemporaryMapper.selectDataId(id);
    }

    public List<Map> selectst(String creattime,String endtime,String dwmc){
        return dwdggbmjdTemporaryMapper.selectst( creattime, endtime, dwmc);
    }
    public  Integer selectall(){ return dwdggbmjdTemporaryMapper.selectall(); }
}
